HOSTNAME=`hostname -s`
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
  ORD=${BASH_REMATCH[2]}
  PORT=$((ORD + 30127))
  export KAFKA_CFG_ADVERTISED_LISTENERS="PLAINTEXT://192.168.1.165:$PORT"
else
  echo "Failed to get index from hostname $HOST"
  exit 1
fi
